<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css" media="all">
    <style type="text/css">
        /* tooltip */
        #tooltip {
            position: absolute;
            border: 1px solid #ccc;
            background: #333;
            padding: 2px;
            display: none;
            color: #fff;
        }

        .a1 {
            height: 30px;
            line-height: 30px;
            margin-left: 10px;
        }

        .a2 {
            height: 30px;
            line-height: 30px;
            padding: 0 10px;
            font-size: 12px;
            background: burlywood;
            border: burlywood;
            color: #fff;
        }

        .a3 {
            height: 30px;
            line-height: 30px;
            padding: 0 10px;
            font-size: 12px;
            background: burlywood;
            border: burlywood;
            margin-right: 10px;
            margin-left: 10px;
            color: #fff;
        }

        .a4 {
            height: 30px;
            line-height: 30px;
            padding: 0 10px;
            font-size: 12px;
            background: red;
            border: red;
            margin-right: 10px;
            margin-left: 10px;
            color: #fff;
        }
    </style>
</head>

<body style="padding:10px;">
    <div class="tplay-body-div">
        <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;border:0">
            <form class="layui-form serch" action="" method="post">
                <div class="layui-form-item zeng" style="float: left;">
                    <button class="layui-btn layui-btn-danger layui-btn-sm" lay-submit="" lay-filter="serch">新增应用</button>
                </div>
            </form>
            <div style="float: left;" class="a1">创建应用需在<a href="http://open-dev.dingtalk.com/" style="color:red;">[钉钉管理后台]</a>创建应用后在来这里添加</div>
            <div style="float: right;" class="fa"><button class="a2">发送消息</div>
            <div style="float: right;" class="bian"><button class="a3"><i class="fa fa-bookmark" aria-hidden="true" style="margin-right: 6px;"></i>编辑</button></div>
            <div style="float: right;" class="shan"><button class="a4"><i class="fa fa-trash" aria-hidden="true" style="margin-right: 6px;"></i>删除</button></button></div>
        </fieldset>
        <table class="layui-table" lay-size="sm">
            <colgroup>
                <col width="30">
                <col width="60">
                <col width="60">
                <col width="100">
                <col width="80">
                <col width="50">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="30">
            </colgroup>
            <thead>
                <tr>
                    <td>名称</td>
                    <td>应用ID</td>
                    <td>排序号</td>
                    <td>是否默认</td>
                    <td>应用提供颜色</td>
                    <td>空说明,不需要设置任何内容</td>
                    <td>ID</td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>滨州市</td>
                    <td>1</td>
                    <td>0</td>
                    <td>是</td>
                    <td></td>
                    <td></td>
                    <td>1</td>
                </tr>
            </tbody>
            <tbody>
                <tr>
                    <td>滨州市</td>
                    <td>1</td>
                    <td>0</td>
                    <td>是</td>
                    <td></td>
                    <td></td>
                    <td>2</td>
                </tr>
            </tbody>
            <tbody>
                <tr>
                    <td>滨州市</td>
                    <td>1</td>
                    <td>0</td>
                    <td>是</td>
                    <td></td>
                    <td></td>
                    <td>3</td>
                </tr>
            </tbody>
        </table>

        {include file="public/foot"}
        <script type="text/javascript">
            $('.delete').click(function() {
                var id = $(this).attr('id');
                layer.confirm('确定要删除?', function(index) {
                    $.ajax({
                        url: "{:url('admin/tomessages/delete')}",
                        data: {
                            id: id
                        },
                        success: function(res) {
                            layer.msg(res.msg);
                            if (res.code == 1) {
                                setTimeout(function() {
                                    location.href = res.url;
                                }, 1500)
                            }
                        }
                    })
                })
            })
        </script>
        <script type="text/javascript">
            layui.use('layer', function() {
                var layer = layui.layer;
                $('.look').click(function() {
                    var id = $(this).attr('data-id');
                    layer.msg('留言标记', {
                        time: 20000,
                        btn: ['标记已读', '标记未读', '再想想'],
                        yes: function(index, layero) {
                            $.ajax({
                                url: "{:url('admin/tomessages/mark')}",
                                type: 'post',
                                data: {
                                    id: id,
                                    is_look: '1'
                                },
                                success: function(res) {
                                    layer.msg(res.msg);
                                    if (res.code == 1) {
                                        setTimeout(function() {
                                            location.href = res.url;
                                        }, 1500)
                                    }
                                }
                            })
                        },
                        btn2: function(index, layero) {
                            $.ajax({
                                url: "{:url('admin/tomessages/mark')}",
                                type: 'post',
                                data: {
                                    id: id,
                                    is_look: '0'
                                },
                                success: function(res) {
                                    layer.msg(res.msg);
                                    if (res.code == 1) {
                                        setTimeout(function() {
                                            location.href = res.url;
                                        }, 1500)
                                    }
                                }
                            })
                        }
                    })
                })
            });
        </script>
        <script>
            $('.fa').click(function() {
                layer.alert('测试演示', {
                    icon: 1
                });
            });
            $('.bian').click(function() {
                layer.alert('测试演示', {
                    icon: 1
                });
            });
            $('.shan').click(function() {
                layer.alert('测试演示', {
                    icon: 1
                });
            });
        </script>
    </div>
</body>

</html>